package com.hxh.exception.handler.controller;

import com.hxh.exception.handler.service.DemoService;
import com.hxh.exception.handler.utils.ResultUtil;
import com.hxh.exception.handler.vo.ResultVO;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@AllArgsConstructor
public class TestController {

    private final DemoService demoService;

    @GetMapping("/serviceException")
    public ResultVO serviceException() {
        demoService.serviceException();
        return ResultUtil.success();
    }

    @GetMapping("/otherException")
    public ResultVO otherException() {
        demoService.otherException();
        return ResultUtil.success();
    }

}
